# Pound - the reverse-proxy load-balancer
# Copyright (C) 2002-2006 Apsis GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# Additionaly compiling, linking, and/or using OpenSSL is expressly allowed.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA  02111-1307, USA.
#
# Contact information:
# Apsis GmbH
# P.O.Box
# 8707 Uetikon am See
# Switzerland
# Tel: +41-44-920 4904
# EMail: roseg@apsis.ch

CC=@PTHREAD_CC@
VERSION=@PACKAGE_VERSION@
CFLAGS=-DF_CONF=\"$(F_CONF)\" -DVERSION=\"${VERSION}\" @CFLAGS@ @PTHREAD_CFLAGS@ @CPPFLAGS@
LIBS=@LIBS@ @PTHREAD_LIBS@

prefix=@prefix@
exec_prefix=@exec_prefix@

# Configuration file default; if none, look at config.c for default!
F_CONF=@sysconfdir@/pound.cfg

OBJS=pound.o http.o config.o svc.o

all:	pound poundctl pound.8

pound:	$(OBJS)
		${CC} @LDFLAGS@ -o pound $(OBJS) $(LIBS)

poundctl:	poundctl.o
		${CC} @LDFLAGS@ -o poundctl poundctl.o $(LIBS)

$(OBJS):	pound.h

install:	all
		@INSTALL@ -d ${DESTDIR}@sbindir@
		@INSTALL@ -o @I_OWNER@ -g @I_GRP@ -m 555 pound ${DESTDIR}@sbindir@/pound
		@INSTALL@ -o @I_OWNER@ -g @I_GRP@ -m 555 poundctl ${DESTDIR}@sbindir@/poundctl
		@INSTALL@ -d ${DESTDIR}@mandir@/man8
		@INSTALL@ -o @I_OWNER@ -g @I_GRP@ -m 644 pound.8 ${DESTDIR}@mandir@/man8/pound.8
		@INSTALL@ -o @I_OWNER@ -g @I_GRP@ -m 644 poundctl.8 ${DESTDIR}@mandir@/man8/poundctl.8

clean:
		rm -f pound $(OBJS) poundctl poundctl.o

uninstall:
		-rm -f @sbindir@/pound @sbindir@/poundctl @mandir@/man8/pound.8 @mandir@/cat8/pound.8 @mandir@/man8/poundctl.8 @mandir@/cat8/poundctl.8
